<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../include/laypublic.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>资格预审新增</title>
</head>
<style>
    .fieldset {
        margin-top: 5px;
        margin-bottom: 0px
    }

    .layui-legend {
        background-color: #5fb878;
        font-size: 15px !important;
        width: 140px;
    }

    .layui-form-item {
        margin-bottom: 5px;
        clear: both;
        *zoom: 1;
    }

    .layui-form-label {
        width: 180px;
    }

    .right {
        float: right;
    }

    .width106 {
        width: 106px;
    }

    .width98 {
        width: 98px;
    }

    .width60 {
        width: 60px;
    }
</style>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab-item layui-show">
            <div style="padding-top:15px;">&nbsp;</div>
            <form class="layui-form" id="addInfo_form" lay-filter="add_info_from">
                <fieldset class="layui-elem-field layui-field-title fieldset" id="baseInfo">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目基础信息 ></legend>
                    <div style="margin-top:20px">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">项目编码</label>
                                <div class="layui-input-inline">
                                    <input type="hidden" name="id" value="${inquiryPro.id}">
                                    <input type="text" name="proName" value="${inquiryPro.proName}" style="border:0px;"
                                           readonly maxlength="100" lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">项目业态</label>
                                <div class="layui-input-inline">
                                    <select name="types" style="border:0px;">
                                        <option value="1"
                                                <c:if test="${inquiryPro.types=='1'}">selected="selected"</c:if>>PPP项目
                                        </option>
                                        <option value="2"
                                                <c:if test="${inquiryPro.types=='2'}">selected="selected"</c:if>>EPC项目
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">项目名称</label>
                                <div class="layui-input-inline">
                                    <input type="hidden" name="id" value="${inquiryPro.id}">
                                    <input type="text" name="proName" value="${inquiryPro.proName}" style="border:0px;"
                                           readonly maxlength="100" lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">项目类型</label>
                                <div class="layui-input-inline">
                                    <select name="types" style="border:0px;">
                                        <option value="1"
                                                <c:if test="${inquiryPro.types=='1'}">selected="selected"</c:if>>PPP项目
                                        </option>
                                        <option value="2"
                                                <c:if test="${inquiryPro.types=='2'}">selected="selected"</c:if>>EPC项目
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">项目地点</label>
                                <div class="layui-input-inline">
                                    <input type="hidden" name="hrOrgId" value="${inquiryPro.hrOrgId}">
                                    <input type="text" value="${inquiryPro.orgName}" style="border:0px;"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">所属公司</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="proCode" id="proCode" value="${inquiryPro.proCode}"
                                           style="border:0px;" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">入库情况</label>
                                    <div class="layui-input-inline">
                                        <select name="isInStore" style="border:0px;">
                                            <option value="">请选择-入库情况</option>
                                            <option value="0" <c:if
                                                    test="${inquiryPro.isInStore=='0'}"> selected="selected"</c:if> >未入库
                                            </option>
                                            <option value="1" <c:if
                                                    test="${inquiryPro.isInStore=='1'}"> selected="selected"</c:if> >已入库
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">营销经理</label>
                                    <div class="layui-input-inline">
                                        <input type="hidden" name="hrStaffMktId">
                                        <input type="text" name="hrStaffName" value="${inquiryPro.hrStaffName}"
                                               style="border:0px" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">运营周期</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="downRate" value="${inquiryPro.downRate}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">建设周期</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="downRate" value="${inquiryPro.staffName}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">项目渠道</label>
                                        <div class="layui-input-inline">
                                            <input type="hidden" name="sgCityId">
                                            <input type="text" name="downRate" value="${inquiryPro.sgCityName}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">合作周期</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="downRate" value="${inquiryPro.pubIncome}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">总投资额</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="downRate" value="${inquiryPro.pppPercent}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">项目简介</label>
                                        <div class="layui-input-inline">
                                            <textarea name="proRemarks" maxlength="500" style="width:899px;height:90px;"
                                                      maxlength="11" lay-verify="required|floatNumber"
                                                      autocomplete="off"
                                                      class="layui-textarea">${inquiryPro.proRemarks}</textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset" id="careerInfo">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目合作方 ></legend>
                    <div style="margin-top:20px" id="coopDiv">
                        <c:forEach items="${inquiryPro.inquiryProCoopVos }" var="coopVo" varStatus="status">
                            <div class="layui-form-item" id="linkRow${status.index+1}">
                                <div class="layui-inline width106">
                                    <p class="right">单位<label>${status.index+1}</label>：</p>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label width60">单位名称</label>
                                    <div class="layui-input-inline" style="width:160px;" <c:if
                                            test="${status.first}"> id="sgCoopSelect"</c:if> >
                                        <select name="sgCoopId" lay-search>
                                            <option value="">请选择-单位名称</option>
                                            <c:if test="${not empty coopInfos }">
                                                <c:forEach items="${coopInfos}" var="coop">
                                                    <option value="${coop.id }" <c:if
                                                            test="${coopVo.sgCoopId==coop.id}"> selected="selected"</c:if>>${coop.coopName }</option>
                                                </c:forEach>
                                            </c:if>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单位作用</label>
                                    <div class="layui-input-inline" style="width:120px;"
                                         <c:if test="${status.first}">id="coopEffectSelect"</c:if> >
                                        <select name="coopEffect">
                                            <option value="">请选择-单位作用</option>
                                            <option value="1" <c:if
                                                    test="${coopVo.coopEffect=='1'}"> selected="selected"</c:if>>关系维护
                                            </option>
                                            <option value="2" <c:if
                                                    test="${coopVo.coopEffect=='2'}"> selected="selected"</c:if>>资质补充
                                            </option>
                                            <option value="3" <c:if
                                                    test="${coopVo.coopEffect=='3'}"> selected="selected"</c:if>>资金投入
                                            </option>
                                            <option value="4" <c:if
                                                    test="${coopVo.coopEffect=='4'}"> selected="selected"</c:if>>运营合作
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">合作类型</label>
                                    <div class="layui-input-inline" style="width:120px;" <c:if
                                            test="${status.first}"> id="cooperationSelect"</c:if> >
                                        <select name="coopEffect">
                                            <option value="">请选择-合作类型</option>
                                            <option value="1" <c:if
                                                    test="${coopVo.coopEffect=='1'}"> selected="selected"</c:if>>居间方
                                            </option>
                                            <option value="2" <c:if
                                                    test="${coopVo.coopEffect=='2'}"> selected="selected"</c:if>>实施机构
                                            </option>
                                            <option value="3" <c:if
                                                    test="${coopVo.coopEffect=='3'}"> selected="selected"</c:if>>招标代理机构
                                            </option>
                                            <option value="4" <c:if
                                                    test="${coopVo.coopEffect=='4'}"> selected="selected"</c:if>>联合体单位
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <button type="button" class="layui-btn layui-btn-sm"
                                            id="addLinkBtn${status.index+1}" onclick="addRow(this);"><i
                                            class="layui-icon">&#xe654;</i></button>
                                    <c:if test="${not status.first}">
                                        <button type="button" class="layui-btn layui-btn-sm" id="delLinkBtn4"
                                                onclick="deleteRow(${status.index+1});"><i
                                                class="layui-icon">&#xe640;</i></button>
                                    </c:if>
                                </div>
                            </div>
                        </c:forEach>
                        <c:if test="${empty inquiryPro.inquiryProCoopVos }">
                            <div class="layui-form-item" id="linkRow1">
                                <div class="layui-inline width106">
                                    <p class="right">单位<label>1</label>：</p>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label width60">单位名称</label>
                                    <div class="layui-input-inline" style="width:160px;" id="sgCoopSelect">
                                        <select name="sgCoopId" lay-search>
                                            <option value="">请选择-单位名称</option>
                                            <c:if test="${not empty coopInfos }">
                                                <c:forEach items="${coopInfos}" var="coop">
                                                    <option value="${coop.id }">${coop.coopName }</option>
                                                </c:forEach>
                                            </c:if>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单位作用</label>
                                    <div class="layui-input-inline" style="width:120px;" id="coopEffectSelect">
                                        <select name="coopEffect">
                                            <option value="">请选择-单位作用</option>
                                            <option value="1">关系维护</option>
                                            <option value="2">资质补充</option>
                                            <option value="3">资金投入</option>
                                            <option value="4">运营合作</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">合作类型</label>
                                    <div class="layui-input-inline" style="width:120px;" id="cooperationSelect">
                                        <select name="cooperationSelect">
                                            <option value="">请选择-合作类型</option>
                                            <option value="1">居间方</option>
                                            <option value="2">实施机构</option>
                                            <option value="3">招标代理机构</option>
                                            <option value="4">联合体单位</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <button type="button" class="layui-btn layui-btn-sm" id="addLinkBtn1"
                                            onclick="addRow(this);"><i class="layui-icon">&#xe654;</i></button>
                                </div>
                            </div>
                        </c:if>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset" id="houseInfo">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目资金信息 ></legend>
                    <div style="margin-top:20px">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">资本金数额（万元）</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="capitalFund" value="${inquiryPro.capitalFund}"
                                           lay-verify="required|floatAmount" placeholder="请输入" maxlength="11"
                                           autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">资本金比例（%）</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="capitalPercent" value="${inquiryPro.capitalPercent}"
                                           lay-verify="required|floatNumber" placeholder="请输入" maxlength="11"
                                           autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">我方股权出资金额（万元）</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="stockFund" value="${inquiryPro.stockFund}"
                                           lay-verify="required|floatAmount" placeholder="请输入" maxlength="11"
                                           autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            `
                            <div class="layui-inline">
                                <label class="layui-form-label">我方股权比例（%）</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="stockPercent" value="${inquiryPro.stockPercent}"
                                           maxlength="11" lay-verify="required|floatNumber" placeholder="请输入"
                                           autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
                                </div>
                            </div>
                            `
                            <div class="layui-inline">
                                <label class="layui-form-label">总投资额（万元）</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="sumAmount" value="${inquiryPro.sumAmount}" id="sumAmount"
                                           style="border:0px;" readonly="readonly" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">建安工程总费用（万元）</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="sumCae" value="${inquiryPro.sumCae}" id="sumCae"
                                           style="border:0px;" readonly="readonly" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>
                        <fieldset class="layui-elem-field layui-field-title fieldset" id="creditInfo">
                            <legend style="margin-left:40px;font-size:15px;font-weight:bold;">投资构成 ></legend>
                            <div style="margin-top:20px">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">建安工程费（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="costCae" value="${inquiryPro.costCae}" id="costCae"
                                                   maxlength="11" lay-verify="required|floatAmount"
                                                   onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">设备购置工程费（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="deviceCost" value="${inquiryPro.deviceCost}"
                                                   id="deviceCost" maxlength="11" lay-verify="required|floatAmount"
                                                   onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">预备费（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="inReadyCost" value="${inquiryPro.inReadyCost}"
                                                   id="inReadyCost" maxlength="11" lay-verify="required|floatAmount"
                                                   onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">建设期利息（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="periodInterest"
                                                   value="${inquiryPro.periodInterest}" id="periodInterest"
                                                   maxlength="11" lay-verify="required|floatAmount"
                                                   onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">铺底流动资金（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="fluidCapital" value="${inquiryPro.fluidCapital}"
                                                   id="fluidCapital" maxlength="11" lay-verify="required|floatAmount"
                                                   onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">工程建设其他费（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="otherCost" value="${inquiryPro.otherCost}"
                                                   id="otherCost" maxlength="11" lay-verify="required|floatAmount"
                                                   onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">其中：征地拆迁费（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="moveOutCost" value="${inquiryPro.moveOutCost}"
                                                   maxlength="11" lay-verify="required|floatAmount" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);arabiaToCN(this,2);"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </fieldset>
                        <fieldset class="layui-elem-field layui-field-title fieldset" id="creditInfo">
                            <legend style="margin-left:40px;font-size:15px;font-weight:bold;">回报机制 ></legend>
                            <div style="margin-top:20px">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">回报机制 &nbsp;&nbsp;</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox" name="backMech" value="1"
                                            <c:if test="${fn:contains(inquiryPro.backMech, '1')}">
                                                   checked="checked"</c:if> title="政府付费" lay-skin="primary">
                                        </div>
                                        <div class="layui-input-inline">
                                            <input type="checkbox" name="backMech" value="2"
                                                   <c:if test="${fn:contains(inquiryPro.backMech, '2')}">checked="checked"</c:if>
                                                   title="可行性缺口补助" lay-skin="primary">
                                        </div>
                                        <div class="layui-input-inline">
                                            <input type="checkbox" name="backMech" value="3"
                                                   <c:if test="${fn:contains(inquiryPro.backMech, '3')}">checked="checked"</c:if>
                                                   title="使用者付费" lay-skin="primary">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">工程费用下浮率（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="downRate" value="${inquiryPro.downRate}"
                                                   maxlength="8" lay-verify="required|floatNumber" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">合理利润率（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="profitRate" value="${inquiryPro.profitRate}"
                                                   maxlength="8" lay-verify="required|floatNumber" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">投资回报率（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="investBackRate"
                                                   value="${inquiryPro.investBackRate}" maxlength="8"
                                                   lay-verify="required|floatNumber" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">折现率（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="discountRate" value="${inquiryPro.discountRate}"
                                                   maxlength="8" lay-verify="required|floatNumber" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">建设期融资利率（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="finRate" value="${inquiryPro.finRate}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">融资回报率（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="finBackRate" value="${inquiryPro.finBackRate}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">资本金回报率（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="capitalBackRate"
                                                   value="${inquiryPro.capitalBackRate}" maxlength="11"
                                                   lay-verify="required|floatNumber" autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">总投资额</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="downRate" value="${inquiryPro.pppPercent}"
                                                   maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">资本金比例（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="capitalPercent"
                                                   value="${inquiryPro.capitalPercent}"
                                                   lay-verify="required|floatNumber" placeholder="请输入" maxlength="11"
                                                   autocomplete="off" onblur="isNumberAndFloat1(this);"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">资本金数额（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="capitalFund" value="${inquiryPro.capitalFund}"
                                                   lay-verify="required|floatAmount" placeholder="请输入" maxlength="11"
                                                   autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);arabiaToCN(this,2);"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">我方股权出资金额（万元）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="stockFund" value="${inquiryPro.stockFund}"
                                                   lay-verify="required|floatAmount" placeholder="请输入" maxlength="11"
                                                   autocomplete="off"
                                                   onblur="isNumberAndFloat1(this);arabiaToCN(this,2);"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">我方股权比例（%）</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="stockPercent" value="${inquiryPro.stockPercent}"
                                                   maxlength="11" lay-verify="required|floatNumber" placeholder="请输入"
                                                   autocomplete="off" onblur="isNumberAndFloat1(this);"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset" id="baseInfo">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目其他信息 ></legend>
                    <div style="margin-top:20px">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">项目优点</label>
                                <div class="layui-input-inline">
                                    <textarea name="proRemarks" maxlength="500" style="width:899px;height:90px;"
                                              maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                              class="layui-textarea">${inquiryPro.proRemarks}</textarea>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">其他说明</label>
                                <div class="layui-input-inline">
                                    <textarea name="proRemarks" maxlength="500" style="width:899px;height:90px;"
                                              maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                              class="layui-textarea">${inquiryPro.proRemarks}</textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset" id="baseInfo">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">底线标准情况 ></legend>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset" id="baseInfo">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">跟踪信息列表 ></legend>
                    <div style="margin-top:20px">
                        <table id="LAY-proPlot-create-manage" lay-filter="LAY-proPlot-create-manage"></table>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目最新进展 ></legend>
                    <div class="table-tools">
                        <p class="layui-btn layuiadmin-btn-admin" data-type="progressTableAddRow">添加一行</p>
                    </div>
                    <div style="margin-top:20px">
                        <table id="LAY-proPlot-new-manage" lay-filter="LAY-proPlot-new-manage"></table>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目风险 ></legend>
                    <div class="table-tools">
                        <p class="layui-btn layuiadmin-btn-admin" data-type="riskTableAddRow">添加一行</p>
                    </div>
                    <div style="margin-top: 20px;">
                        <table id="LAY-proPlot-risk-manage" lay-filter="LAY-proPlot-risk-manage"></table>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目最新进展 ></legend>
                    <div style="margin-top:20px">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">项目重要等级</label>
                                <div class="layui-input-inline">
                                    <input type="hidden" name="id" value="${inquiryPro.id}">
                                    <input type="text" name="proName" value="${inquiryPro.proName}" style="border:0px;"
                                           readonly maxlength="100" lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">跟踪人员</label>
                                <div class="layui-input-inline">
                                    <input type="hidden" name="id" value="${inquiryPro.id}">
                                    <input type="text" name="proName" value="${inquiryPro.proName}" style="border:0px;"
                                           readonly maxlength="100" lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">跟踪日期</label>
                                <div class="layui-input-inline">
                                    <input type="hidden" name="id" value="${inquiryPro.id}">
                                    <input type="text" name="proName" value="${inquiryPro.proName}" style="border:0px;"
                                           readonly maxlength="100" lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">项目阶段</label>
                                <div class="layui-input-inline">
                                    <input type="hidden" name="id" value="${inquiryPro.id}">
                                    <input type="text" name="proName" value="${inquiryPro.proName}" style="border:0px;"
                                           readonly maxlength="100" lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">推进情况</label>
                                <div class="layui-input-inline">
                                    <textarea name="proRemarks" maxlength="500" style="width:899px;height:90px;"
                                              maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                              class="layui-textarea">${inquiryPro.proRemarks}</textarea>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">后续推进计划</label>
                                <div class="layui-input-inline">
                                    <textarea name="proRemarks" maxlength="500" style="width:899px;height:90px;"
                                              maxlength="11" lay-verify="required|floatNumber" autocomplete="off"
                                              class="layui-textarea">${inquiryPro.proRemarks}</textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field layui-field-title fieldset">
                    <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">附件信息 ></legend>
                    <div style="margin-top:20px;">
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、图片资料，可上传多个</label>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">招标文件（选填）</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" id="21-upload-more">上传</button>
                                    <div class="layui-upload-list" id="21-upload-more-list">
                                        <c:forEach items="${inquiryPro.inquiryProAtts }" var="fileAtt">
                                            <c:if test="${fileAtt.types == '21' }">
                                                <div class="layui-upload-img-div" id="upload_img_${fileAtt.id}">
                                                    <c:choose>
                                                        <c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
                                                            <img src="${fileHttpPre }/${fileAtt.filePath }"
                                                                 title="${fileAtt.fileName}" class="layui-upload-img">
                                                        </c:when>
                                                        <c:otherwise>
                                                            <img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg"
                                                                 title="${fileAtt.fileName}" class="layui-upload-img">
                                                        </c:otherwise>
                                                    </c:choose>
                                                    <div class="mask">
                                                        <a href="javascript:void(0)"
                                                           onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
                                                        <a href="javascript:void(0)"
                                                           onclick="del('${fileAtt.id}')">删除</a>
                                                    </div>
                                                    <p>${fileAtt.fileName}</p>
                                                    <input type="hidden"
                                                           value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix}|${fileAtt.id}|${fileAtt.filePath} "
                                                           id="fileAtt_${fileAtt.id}" name="fileAtt21"/>
                                                </div>
                                            </c:if>
                                        </c:forEach>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">项目实施方案（选填）</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" id="22-upload-more">上传</button>
                                    <div class="layui-upload-list" id="22-upload-more-list">
                                        <c:forEach items="${inquiryPro.inquiryProAtts }" var="fileAtt">
                                            <c:if test="${fileAtt.types == '22' }">
                                                <div class="layui-upload-img-div" id="upload_img_${fileAtt.id}">
                                                    <c:choose>
                                                        <c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
                                                            <img src="${fileHttpPre }/${fileAtt.filePath }"
                                                                 title="${fileAtt.fileName}" class="layui-upload-img">
                                                        </c:when>
                                                        <c:otherwise>
                                                            <img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg"
                                                                 title="${fileAtt.fileName}" class="layui-upload-img">
                                                        </c:otherwise>
                                                    </c:choose>
                                                    <div class="mask">
                                                        <a href="javascript:void(0)"
                                                           onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
                                                        <a href="javascript:void(0)"
                                                           onclick="del('${fileAtt.id}')">删除</a>
                                                    </div>
                                                    <p>${fileAtt.fileName}</p>
                                                    <input type="hidden"
                                                           value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix}|${fileAtt.id}|${fileAtt.filePath} "
                                                           id="fileAtt_${fileAtt.id}" name="fileAtt22"/>
                                                </div>
                                            </c:if>
                                        </c:forEach>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">其他资料（选填）</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" id="23-upload-more">上传</button>
                                    <div class="layui-upload-list" id="23-upload-more-list">
                                        <c:forEach items="${inquiryPro.inquiryProAtts }" var="fileAtt">
                                            <c:if test="${fileAtt.types == '23' }">
                                                <div class="layui-upload-img-div" id="upload_img_${fileAtt.id}">
                                                    <c:choose>
                                                        <c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
                                                            <img src="${fileHttpPre }/${fileAtt.filePath }"
                                                                 title="${fileAtt.fileName}" class="layui-upload-img">
                                                        </c:when>
                                                        <c:otherwise>
                                                            <img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg"
                                                                 title="${fileAtt.fileName}" class="layui-upload-img">
                                                        </c:otherwise>
                                                    </c:choose>
                                                    <div class="mask">
                                                        <a href="javascript:void(0)"
                                                           onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
                                                        <a href="javascript:void(0)"
                                                           onclick="del('${fileAtt.id}')">删除</a>
                                                    </div>
                                                    <p>${fileAtt.fileName}</p>
                                                    <input type="hidden"
                                                           value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix}|${fileAtt.id}|${fileAtt.filePath} "
                                                           id="fileAtt_${fileAtt.id}" name="fileAtt23"/>
                                                </div>
                                            </c:if>
                                        </c:forEach>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </fieldset>
                <div class="layui-form-item" style="position: fixed ! important; right: 30px; top:4%;z-index:10000;">
                    <div class="layui-input-block">
                        <%--<button class="layui-btn layui-bg-blue layui-btn-normal layui-btn-lg  layui-btn-radius" type="button" lay-submit lay-filter="addInfo_form_submit" id="addInfo_form_submit">
                        <i class="layui-icon layui-icon-ok layuiadmin-button-btn"></i>
                        提交
                        </button>--%>
                        <input type="hidden" name="submitType" id="submitType">
                        <button type="button" type="button" class="layui-btn layui-btn-primary layui-btn-radius"
                                lay-submit lay-filter="addInfo_form_submit" id="addInfo_form_submit2">保存
                        </button>
                        <c:if test="${edit=='edit'}">
                            <button type="button" type="button" class="layui-btn layui-btn-radius" lay-submit
                                    lay-filter="addInfo_form_submit" id="addInfo_form_submit">提交
                            </button>
                        </c:if>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    //静态资源路径前缀
    var staticPath = '${fileHttpPre}';
    var stateJSON = <infopub:dicJson groupNo="A00010028" />;

    layui.config({
        base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set', 'upload', 'element', 'laydate', 'table', 'dropdown'], function () {
        var $ = layui.$
            , form = layui.form
            , element = layui.element
            , laydate = layui.laydate
            , table = layui.table
            , upload = layui.upload
            // , dropdown = layui.dropdown
            , active = {
            progressTableAddRow: function () {
                //用这句话应该能拿到;
                var tableData = table.cache["LAY-proPlot-new-manage"];
                console.info(JSON.stringify(tableData));
                tableData.push({
                    keyPoints: "",
                    solveWay: "",
                    needSupport: "",
                    latestReply: "",
                    isNew: true
                })
                table.render({
                    elem: '#LAY-proPlot-new-manage'
                    , data: tableData
                    , cols: [[
                        {
                            field: 'keyPoints',
                            edit: 'text',
                            title: '项目推进存在难点、卡点',
                            width: '25%',
                            align: 'center',
                            style: 'background-color: #FFFFFF; color: #000'
                        }
                        , {
                            field: 'solveWay',
                            edit: 'text',
                            title: '解决思路与措施',
                            width: '25%',
                            align: 'center',
                            style: 'background-color: #FFFFFF; color: #000'
                        }
                        , {
                            field: 'needSupport',
                            edit: 'text',
                            title: '需要集团协助事项',
                            width: '25%',
                            align: 'center',
                            style: 'background-color: #FFFFFF; color: #000'
                        }
                        , {
                            field: 'latestReply',
                            edit: 'text',
                            title: '最新回复',
                            width: '25%',
                            align: 'center',
                            style: 'background-color: #FFFFFF; color: #000'
                        }
                    ]]
                    , page: false
                    , done: function (res, curr, count) {
                        // debugger
                        $('tr').css({'background-color': '#009688', 'color': '#fff'});
                    },
                });
            },
            riskTableAddRow: function () {
                var tableData = table.cache["LAY-proPlot-risk-manage"];
                tableData.push({
                    describe: "",
                    level: 1,
                    strategy: "",
                    progress: "",
                    appendix: "",
                    isNew: true
                })
                makeRiskTable(table, tableData)
            }
        };
console.info(table);
        var proCode = $('#proCode').val();
        laydate.render({
            elem: '#sent-laydate-signup'
        });
        laydate.render({
            elem: '#sent-laydate-inquiry'
        });
        laydate.render({
            elem: '#sent-laydate-bond'
        });
        // 正则校验
        form.verify({
            //验证汉字
            CHS: [
                /^[\u0391-\uFFE5]+$/
                , '只能输入汉字'
            ],
            //大于0的正整数
            intNumber: [
                /^[1-9]\d*$/
                , '请输入正确的数字'
            ],
            //数字只能有两位小数
            floatNumber: [
                /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
                , '请输入正确的数字'
            ],
            //数字大于等于0，并只能有两位小数
            floatAmount: [
                /^([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
                //var pattern=/^((\d+\.\d*[1-9]\d{1})|(\d*[1-9]\d*\.\d{2}))$/;
                , '请输入正确的数字'
            ]
        });
        layer.ready(function () {
        });

        //招标文件（选填）
        upload.render({
            elem: '#21-upload-more'
            ,
            url: basePath + '/inquiryPro/uploadAtt/'
            ,
            data: {
                types: 21
            }
            ,
            multiple: true
            ,
            accept: 'file'
            ,
            acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
            ,
            before: function (obj) { //obj参数包含的信息
                layer.load(); //上传loading
            }
            ,
            done: function (res) {
                //如果上传失败
                if (res.code > 0) {
                    layer.closeAll('loading'); //关闭loading
                    return layer.msg(res.msg, {icon: 7});
                }
                //上传完毕
                if (res.entity != null && res.entity.length > 0) {
                    for (var i in res.entity) {
                        var inquiryPro = res.entity[i];
                        var arr = inquiryPro.split("|");
                        var imgSrc = "";
                        var suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                        if (suffix == 'jpg' || suffix == 'png') {
                            imgSrc = "${fileHttpPre}/" + arr[3];
                        } else {
                            imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                        }
                        $('#21-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="' + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}" + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\'' + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="' + inquiryPro + '" id="fileAtt_' + arr[2] + '" name="fileAtt21" ></input></div> ');
                    }
                }
            }
            ,
            allDone: function (obj) { //当文件全部被提交后，才触发
                layer.closeAll('loading'); //关闭loading
            }
            ,
            error: function () {
                layer.closeAll('loading'); //关闭loading
                //上传失败
                layer.msg("上传失败，请稍后再试~", {icon: 7});
            }
        });

        //项目实施方案（选填）
        upload.render({
            elem: '#22-upload-more'
            ,
            url: basePath + '/inquiryPro/uploadAtt/'
            ,
            data: {
                types: 22
            }
            ,
            multiple: true
            ,
            accept: 'file'
            ,
            acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
            ,
            before: function (obj) { //obj参数包含的信息
                layer.load(); //上传loading
            }
            ,
            done: function (res) {
                //如果上传失败
                if (res.code > 0) {
                    layer.closeAll('loading'); //关闭loading
                    return layer.msg(res.msg, {icon: 7});
                }
                //上传完毕
                if (res.entity != null && res.entity.length > 0) {
                    for (var i in res.entity) {
                        var fileAtt = res.entity[i];
                        var arr = fileAtt.split("|");
                        var imgSrc = "";
                        var suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                        if (suffix == 'jpg' || suffix == 'png') {
                            imgSrc = "${fileHttpPre}/" + arr[3];
                        } else {
                            imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                        }
                        $('#22-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="' + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}" + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\'' + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="' + fileAtt + '" id="fileAtt_' + arr[2] + '" name="fileAtt22" ></input></div> ');
                    }
                }
            }
            ,
            allDone: function (obj) { //当文件全部被提交后，才触发
                layer.closeAll('loading'); //关闭loading
            }
            ,
            error: function () {
                layer.closeAll('loading'); //关闭loading
                //上传失败
                layer.msg("上传失败，请稍后再试~", {icon: 7});
            }
        });

        //其他资料（选填）
        upload.render({
            elem: '#23-upload-more'
            ,
            url: basePath + '/inquiryPro/uploadAtt/'
            ,
            data: {
                types: 23
            }
            ,
            multiple: true
            ,
            accept: 'file'
            ,
            acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
            ,
            before: function (obj) { //obj参数包含的信息
                layer.load(); //上传loading
            }
            ,
            done: function (res) {
                //如果上传失败
                if (res.code > 0) {
                    layer.closeAll('loading'); //关闭loading
                    return layer.msg(res.msg, {icon: 7});
                }
                //上传完毕
                if (res.entity != null && res.entity.length > 0) {
                    for (var i in res.entity) {
                        var fileAtt = res.entity[i];
                        var arr = fileAtt.split("|");
                        var imgSrc = "";
                        var suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                        if (suffix == 'jpg' || suffix == 'png') {
                            imgSrc = "${fileHttpPre}/" + arr[3];
                        } else {
                            imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                        }
                        $('#23-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="' + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}" + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\'' + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="' + fileAtt + '" id="fileAtt_' + arr[2] + '" name="fileAtt23" ></input></div> ');
                    }
                }
            }
            ,
            allDone: function (obj) { //当文件全部被提交后，才触发
                layer.closeAll('loading'); //关闭loading
            }
            ,
            error: function () {
                layer.closeAll('loading'); //关闭loading
                //上传失败
                layer.msg("上传失败，请稍后再试~", {icon: 7});
            }
        });


        // 项目跟踪信息列表
        table.render({
            elem: '#LAY-proPlot-create-manage'
            ,
            url: basePath + '/proTrack/proTrackPage?proCode=' + proCode //请求数据接口  ?hrStaffApplyId=${SESSION_KEY_USER_DETAIL.hrStaffId }
            ,
            cols: [[
                {
                    field: 'trackDate',
                    title: '日期',
                    width: '15%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000',
                    templet: function (d) {
                        return layui.util.toDateString(d.trackDate, "yyyy-MM-dd");
                    }
                }
                , {
                    field: 'addName',
                    title: '跟踪人员',
                    width: '15%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                /*,{field: 'proCode', title: '项目编号', width: 160,align:'center'}
                ,{field: 'proName', title: '项目名称', width: 280,align:'center'}
                ,{field: 'hrStaffMktName', title: '营销经理', width: 123,align:'center'}
                ,{field: 'orgName', title: '申请公司',width: 300,align:'center'}
                ,{field: 'deptName', title: '申请部门',width: 140,align:'center'}*/
                , {
                    field: 'proStage',
                    width: '10%',
                    title: '项目阶段',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000',
                    templet: function (d) {
                        var stateStr = '';
                        if (d.proStage == '1') {
                            stateStr = '预立项';
                        } else if (d.proStage == '2') {
                            stateStr = '立项策划';
                        } else if (d.proStage == '3') {
                            stateStr = '立项';
                        } else if (d.proStage == '4') {
                            stateStr = '营销策划';
                        } else if (d.proStage == '5') {
                            stateStr = '资格预审';
                        } else if (d.proStage == '6') {
                            stateStr = '招标文件分析';
                        } else if (d.proStage == '7') {
                            stateStr = '标书策划';
                        } else if (d.proStage == '8') {
                            stateStr = '投标决策';
                        } else if (d.proStage == '9') {
                            stateStr = '投标保证金申请';
                        } else if (d.proStage == '10') {
                            stateStr = '项目投标';
                        } else if (d.proStage == '11') {
                            stateStr = '交底';
                        } else if (d.proStage == '12') {
                            stateStr = '标后总结';
                        }
                        return stateStr;
                    }
                }
                , {
                    field: 'todayMemo',
                    title: '当日推进情况',
                    width: '25%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                , {
                    field: 'tomorrowPlan',
                    title: '次日推进计划',
                    width: '25%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                , {
                    title: '操作',
                    width: '10%',
                    align: 'center',
                    fixed: 'right',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000',
                    templet: function (d) {
                        var optStr = "";
                        <shiro:hasPermission name="VIEW_PRO_TRACK">
                        optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>查看</a> ';
                        </shiro:hasPermission>
                        return optStr;
                    }
                }
            ]]
            ,
            page: true
            ,
            limit: 10,
            done: function (res, curr, count) {
                $('tr').css({'background-color': '#009688', 'color': '#fff'});
            },
        });
        //项目最新进展(表格)
        table.render({
            elem: '#LAY-proPlot-new-manage'
            ,
            url: basePath + '/proTrack/proTrackDevelopPage?proCode=' + proCode //请求数据接口  ?hrStaffApplyId=${SESSION_KEY_USER_DETAIL.hrStaffId }
            ,
            cols: [[
                {
                    field: 'keyPoints',
                    title: '项目推进存在难点、卡点',
                    width: '25%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                , {
                    field: 'solveWay',
                    title: '解决思路与措施',
                    width: '25%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                , {
                    field: 'needSupport',
                    title: '需要集团协助事项',
                    width: '25%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                , {
                    field: 'latestReply',
                    title: '最新回复',
                    width: '25%',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
            ]]
            ,
            page: false
            // ,limit: 10,
            ,
            done: function (res, curr, count) {
                // debugger
                $('tr').css({'background-color': '#009688', 'color': '#fff'});
            },
        });
        //项目风险
        makeRiskTable(table, []) //之后有接口了把url写进第三个参数

        //项目名称select监听
        form.on('select(add_select_proId)', function (data) {
            var id = data.value;
            if (id == null || id == '') {
                return;
            }
            //获取公司下的所有部门
            $.ajax({
                type: "POST", //提交方式
                url: "${ctx}/setupPro/getSetupProById",//路径
                data: {
                    "id": id
                },//数据，这里使用的是Json格式进行传输
                success: function (result) {//返回数据根据结果进行相应的处理
                    if (result.flag == true) {
                        form.val('add_info_from', result.setupPro); // 填充原值
                        var setupPro = result.setupPro;
                        if (setupPro.fromChannel == '2') {
                            $("#linkPower").attr("lay-verify", "required");
                            $("#linkPowerDiv").show();
                        } else {
                            $("#linkPower").removeAttr("lay-verify");
                            $("#linkPowerDiv").hide();
                        }
                        var strBuffer = "";
                        var sgCoopDiv = $("#sgCoopSelect").clone();
                        var coopEffectDiv = $("#coopEffectSelect").clone();
                        if (setupPro.setupProCoopVos.length == 0) {
                            $('#linkRow1').find('select[name=sgCoopId]').val('');
                            $('#linkRow1').find('select[name=coopEffect]').val('');
                            $('#delLinkBtn1').hide();
                            var rowLength = $("div[id^='linkRow']").length;
                            if (rowLength > 1) {
                                $("div[id^='linkRow']").each(function () {
                                    var tId = $(this).attr("id").substring(7);
                                    if (tId != '1') {
                                        $(this).remove();
                                    }
                                });
                            }
                            form.render('select');
                        } else if (setupPro.setupProCoopVos.length == 1) {
                            $('#linkRow1').find('select[name=sgCoopId]').val(setupPro.setupProCoopVos[0].sgCoopId);
                            $('#linkRow1').find('select[name=coopEffect]').val(setupPro.setupProCoopVos[0].coopEffect);
                            $('#delLinkBtn1').hide();
                            var rowLength = $("div[id^='linkRow']").length;
                            if (rowLength > 1) {
                                $("div[id^='linkRow']").each(function () {
                                    var tId = $(this).attr("id").substring(7);
                                    if (tId != '1') {
                                        $(this).remove();
                                    }
                                });
                            }
                            form.render('select');
                        } else {
                            $("div[id^='linkRow']").each(function () {
                                var tId = $(this).attr("id").substring(7);
                                if (tId != '1') {
                                    $(this).remove();
                                }
                            });
                            layui.$.each(setupPro.setupProCoopVos, function (ind, item) {
                                //第一个需要先赋值
                                if (ind == 0) {
                                    $('#linkRow1').find('select[name=sgCoopId]').val(setupPro.setupProCoopVos[0].sgCoopId);
                                    $('#linkRow1').find('select[name=coopEffect]').val(setupPro.setupProCoopVos[0].coopEffect);
                                    $('#delLinkBtn1').show();
                                } else {
                                    var i = ind + 1;
                                    strBuffer += '<div class="layui-form-item" id="linkRow' + i + '">';
                                    strBuffer += '	<div class="layui-inline width106">';
                                    strBuffer += '		<p class="right">单位<label>' + i + '</label>：</p>';
                                    strBuffer += '	</div>';
                                    strBuffer += '	<div class="layui-inline">';
                                    strBuffer += '		<label class="layui-form-label width60">单位名称</label>';
                                    strBuffer += '		<div class="layui-input-inline">';
                                    strBuffer += sgCoopDiv.html();
                                    strBuffer += '		</div>';
                                    strBuffer += '	</div>';
                                    strBuffer += '	<div class="layui-inline">';
                                    strBuffer += '		<label class="layui-form-label">单位作用</label>';
                                    strBuffer += '		<div class="layui-input-inline">';
                                    strBuffer += coopEffectDiv.html();
                                    strBuffer += '		</div>';
                                    strBuffer += '	</div>';
                                    medalHtml += '	<div class="layui-inline">';
                                    medalHtml += '		<label class="layui-form-label">合作类型</label>';
                                    medalHtml += '		<div class="layui-input-inline" style="width:120px;">';
                                    medalHtml += cooperationDiv.html();
                                    medalHtml += '		</div>';
                                    medalHtml += '	</div>';
                                    strBuffer += '	<div class="layui-inline">';
                                    strBuffer += '		<button type="button" class="layui-btn layui-btn-sm" id="addLinkBtn' + i + '" onclick="addRow(this);"><i class="layui-icon">&#xe654;</i></button>';
                                    if (i > 1) {
                                        strBuffer += '		<button type="button" class="layui-btn layui-btn-sm" id="delLinkBtn' + i + '" onclick="deleteRow(' + i + ');"><i class="layui-icon">&#xe640;</i></button>';
                                    }
                                    strBuffer += '	</div>';
                                    strBuffer += '</div>';
                                    $('#coopDiv').append(strBuffer);
                                    $('#linkRow' + i).find('select[name=sgCoopId]').val(item.sgCoopId);
                                    $('#linkRow' + i).find('select[name=coopEffect]').val(item.coopEffect);
                                    form.render('select');
                                }
                            });
                        }
                        //项目子项页面拼接
                        if (setupPro.setupProSubs.length == 1) {
                            $('#commRow1').find('input[name=subName]').val(setupPro.setupProSubs[0].subName);
                            $('#commRow1').find('input[name=subWorkYears]').val(setupPro.setupProSubs[0].workYears);
                            $('#commRow1').find('input[name=subBuildYears]').val(setupPro.setupProSubs[0].buildYears);
                            $('#commRow1').find('input[name=subOmYears]').val(setupPro.setupProSubs[0].omYears);
                            $('#delCommBtn1').hide();
                            var rowLength = $("div[id^='commRow']").length;
                            if (rowLength > 1) {
                                $("div[id^='commRow']").each(function () {
                                    var tId = $(this).attr("id").substring(7);
                                    if (tId != '1') {
                                        $(this).remove();
                                    }
                                });
                            }
                            form.render('select');
                        } else {
                            $('#subDiv').html('');
                            layui.$.each(setupPro.setupProSubs, function (i, item) {
                                var ind = i + 1;
                                var medalHtml = '';
                                medalHtml += '<div id="commRow' + ind + '">';
                                medalHtml += '	<div class="layui-form-item">';
                                medalHtml += '	<div class="layui-inline width106">';
                                medalHtml += '		<p class="right">子项<label>' + ind + '</label>：</p>';
                                medalHtml += '		<input type="hidden" name="orderIdx" value="' + ind + '"/>';
                                medalHtml += '	</div>';
                                medalHtml += '	<div class="layui-inline">';
                                medalHtml += '		<label class="layui-form-label width60">子项名称</label>';
                                medalHtml += '		<div class="layui-input-inline" style="width:120px;">';
                                medalHtml += '			<input type="text" name="subName" value="' + item.subName + '" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">';
                                medalHtml += '		</div>';
                                medalHtml += '	</div>';
                                medalHtml += '	<div class="layui-inline">';
                                medalHtml += '		<label class="layui-form-label width98">合作周期（年）</label>';
                                medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
                                medalHtml += '			<input type="text" name="subWorkYears" value="' + item.workYears + '" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
                                medalHtml += '		</div>';
                                medalHtml += '	</div>';
                                medalHtml += '	<div class="layui-inline">';
                                medalHtml += '		<label class="layui-form-label width98">建设周期（年）</label>';
                                medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
                                medalHtml += '			<input type="text" name="subBuildYears" value="' + item.buildYears + '" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
                                medalHtml += '		</div>';
                                medalHtml += '	</div>';
                                medalHtml += '	<div class="layui-inline">';
                                medalHtml += '		<label class="layui-form-label width98">运营周期（年）</label>';
                                medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
                                medalHtml += '			<input type="text" name="subOmYears" value="' + item.omYears + '" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
                                medalHtml += '		</div>';
                                medalHtml += '	</div>';
                                medalHtml += '	<div class="layui-inline">';
                                medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addCommBtn' + ind + '" onclick="addCommRow(this);"><i class="layui-icon">&#xe654;</i></button>';
                                medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delCommBtn' + ind + '" onclick="deleteCommRow(' + ind + ');"><i class="layui-icon">&#xe640;</i></button>';
                                medalHtml += '	</div>';
                                medalHtml += '	</div>';
                                medalHtml += '</div>';
                                $('#subDiv').append(medalHtml);
                            });
                            form.render();
                        }

                        //获取回报机制复选框
                        var backCheckbox = $("input[name=backMech]");
                        backCheckbox.each(function () {
                            if (setupPro.backMech.indexOf($(this).val()) != -1) {
                                $(this).prop('checked', true);
                            } else {
                                $(this).prop('checked', false);
                            }
                            form.render();
                        })
                    } else {
                        layer.msg('数据通信异常~', {icon: 0});
                    }
                }
            });
        });

        //项目渠道select监听
        form.on('select(add_selectFromChannel)', function (data) {
            var fromChannel = data.value;
            if (fromChannel == '1') {
                $("#linkPower").removeAttr("lay-verify");
                $("#linkPowerDiv").hide();
            } else {
                $("#linkPower").attr("lay-verify", "required");
                $("#linkPowerDiv").show();
            }
        });

        //监听提交
        form.on('submit(addInfo_form_submit)', function (data) {
            /*var backMechCount = $('input[name=backMech]:checked').length;
            if(backMechCount < 1){
                layer.msg("回报机制至少选中一个",{icon: 0});
                return;
            }
            if(backMechCount > 2){
                layer.msg("回报机制最多选中两个",{icon: 0});
                return;
            }
            $("#addInfo_form_submit").removeAttr("lay-submit").removeClass("layui-bg-blue").addClass("layui-btn-disabled");*/
            var btnId = data.elem.id
            $("#" + btnId).removeAttr("lay-submit").removeClass("layui-bg-blue").addClass("layui-btn-disabled");
            if (btnId == 'addInfo_form_submit') {
                $("#submitType").val('2');
            } else {
                $("#submitType").val('1');
            }
            var url = '/inquiryPro/save';
            if (data.field.id && data.field.id != '') {
                url = '/inquiryPro/edit';
            }
            layer.load();
            //提交 Ajax 成功后，静态更新表格中的数据
            $.ajax({
                type: 'post',
                url: basePath + url,
                data: $('#addInfo_form').serialize(),
                success: function (result) {
                    if (result.success) {
                        layer.closeAll('loading'); //关闭loading
                        layer.msg('提交单据成功~', {icon: 1});
                        //两秒后关闭当前页面
                        setTimeout(function () {
                            /**
                             * 查找父菜单，并刷新
                             */
                            var topDoc = $(window.top.document);
                            var path = basePath + '/inquiryPro/list';
                            // 获取页面名称
                            var name = topDoc.find(".layui-nav-item [lay-href^='" + path + "']").text();
                            if (name == '' || name == null) {
                                name = '资格预审';
                            }
                            window.parent.layui.index.openTabsPage(path, name);
                            var iframe = window.parent.layui.admin.tabsBody(window.parent.layui.admin.tabsPage.index).find(".layadmin-iframe");
                            iframe[0].contentWindow.location.reload(true);

                            /**
                             * 关闭当前页
                             */
                            var currPath = basePath + '/inquiryPro/add';
                            if (data.field.id && data.field.id != '') {
                                currPath = basePath + '/inquiryPro/toDetail?id=' + data.field.id;
                            } else {
                                currPath = basePath + '/inquiryPro/add';
                            }
                            var layid = topDoc.find("li[lay-id^='" + currPath + "']").attr('lay-id');
                            window.parent.layui.element.tabDelete('layadmin-layout-tabs', layid);//关闭当前页
                        }, 2000);
                    } else {
                        layer.closeAll('loading'); //关闭loading
                        $("#addInfo_form_submit").removeClass("layui-btn-disabled").addClass("layui-bg-blue").attr("lay-submit", "");
                        layer.msg(result.msg, {icon: 7});
                    }
                }
            });
        });
        // data-type事件
        $('.layui-btn.layuiadmin-btn-admin').on('click', function (e) {
            e.stopPropagation();
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });

    //制作项目风险表格
    function makeRiskTable(table, data, url) {
        var option = {
            elem: '#LAY-proPlot-risk-manage'
            , cols: [[
                {
                    field: 'describe',
                    edit: 'text',
                    title: '风险描述',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                , {
                    field: 'level',
                    title: '风险等级',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000',
                    templet: function (val, index) {
                        return '<a class="risk-level-picker" data-index="' + index + '">' + getLevel(val.level) + '<i class="layui-icon layui-icon-down layui-font-12"></i></a>'
                    }
                }
                , {
                    field: 'strategy',
                    edit: 'text',
                    title: '处理策略',
                    align: 'center',
                    style: 'background-color: #FFFFFF; color: #000'
                }
                , {field: 'progress', title: '最新进展', align: 'center', style: 'background-color: #FFFFFF; color: #000'}
                , {field: 'appendix', title: '附件', align: 'center', style: 'background-color: #FFFFFF; color: #000'}

            ]]
            , page: false
            // ,limit: 10,
            , done: function (res, curr, count) {
                // debugger
                console.info(res,curr,count);
                //点击回调-风险等级
                dropdown.render({
                    elem: '.risk-level-picker'
                    , data: [{
                        title: '低'
                        , id: 1
                    }, {
                        title: '中'
                        , id: 2
                    }, {
                        title: '高'
                        , id: 3
                    }]
                    , click: function (data, othis) {
                        var elem = $(this.elem)
                            , index = elem.data('index'); //表格列表的预埋数据
                        layer.msg('得到表格列表的 index：' + index + '，下拉菜单 id：' + data.id);
                    }
                });
                layui.$('tr').css({'background-color': '#009688', 'color': '#fff'});
            },
        }
        if (url) option.url = url;
        else option.data = data || [];
        table.render(option);

        function getLevel(level) {
            switch (level) {
                case 1:
                    return '低'
                case 2:
                    return '中'
                case 3:
                    return '高'
                default:
                    return '低'
            }
        }
    }

    //新增联合体单位
    function addRow(t) {
        var $ = layui.$;
        var thisid = $(t).attr("id").substring(10);
        thisid = $("div[id=linkRow" + thisid + "]").find("div:first").find("label").html();
        thisid = parseInt(thisid);
        var nextIndex = parseInt(thisid) + 1;
        var maxInd = $("div[id^='linkRow']").length;
        $("div[id^='linkRow']").each(function () {
            var tId = $(this).attr("id").substring(7);
            tId = parseInt(tId);
            if (tId > maxInd) {
                maxInd = parseInt(tId);
            }
            var thisIndex = $(this).find("div:first").find("label").html();
            thisIndex = parseInt(thisIndex);
            var nextId = thisIndex + 1;
            if (thisIndex > thisid) {
                $("div[id=linkRow" + tId + "]").find("div:first").find("label").html(nextId);
            }
        });
        var ind = maxInd + 1;
        var sgCoopDiv = $("#sgCoopSelect").clone();
        var coopEffectDiv = $("#coopEffectSelect").clone();
        var cooperationDiv = $("#cooperationSelect").clone();
        var medalHtml = '';
        medalHtml += '<div class="layui-form-item" id="linkRow' + ind + '">';
        medalHtml += '	<div class="layui-inline width106">';
        medalHtml += '		<p class="right">单位<label>' + nextIndex + '</label>：</p>';
        medalHtml += '		<input type="hidden" name="linkShowIndex" value="' + nextIndex + '"/>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<label class="layui-form-label width60">单位名称</label>';
        medalHtml += '		<div class="layui-input-inline" style="width:160px;">';
        medalHtml += sgCoopDiv.html();
        medalHtml += '		</div>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<label class="layui-form-label">单位作用</label>';
        medalHtml += '		<div class="layui-input-inline" style="width:120px;">';
        medalHtml += coopEffectDiv.html();
        medalHtml += '		</div>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<label class="layui-form-label">合作类型</label>';
        medalHtml += '		<div class="layui-input-inline" style="width:120px;">';
        medalHtml += cooperationDiv.html();
        medalHtml += '		</div>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addLinkBtn' + ind + '" onclick="addRow(this);"><i class="layui-icon">&#xe654;</i></button>';
        medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delLinkBtn' + ind + '" onclick="deleteRow(' + ind + ');"><i class="layui-icon">&#xe640;</i></button>';
        medalHtml += '	</div>';
        medalHtml += '</div>';
        $(t).parent().parent().after(medalHtml);
        layui.form.render();
    }

    //删除一行
    function deleteRow(id) {
        var $ = layui.$;
        layui.layer.confirm('确定删除？', {icon: 3, title: '提示'}, function (index) {
            var thisid = $("div[id=linkRow" + id + "]").find("div:first").find("label").html();
            thisid = parseInt(thisid);
            $("div[id^='linkRow']").each(function () {
                var tId = $(this).attr("id").substring(7);
                tId = parseInt(tId);
                var thisIndex = $("div[id=linkRow" + tId + "]").find("div:first").find("label").html();
                thisIndex = parseInt(thisIndex);
                var nextId = thisIndex - 1;
                if (thisIndex > thisid) {
                    $("div[id=linkRow" + tId + "]").find("div:first").find("label").html(nextId);
                }
            });
            $("#linkRow" + id).remove();
            layui.layer.close(index);
        });
    }

    //新增子项
    function addCommRow(t) {
        var $ = layui.$;
        var delBtnCount = $("button[id^='delCommBtn']").length;
        if (delBtnCount == 1) {
            $("button[id^='delCommBtn']").each(function () {
                $(this).removeAttr("style");
            });
        }
        var thisid = $(t).attr("id").substring(10);
        thisid = $("div[id=commRow" + thisid + "]").find(".width106").find("label").html();
        thisid = parseInt(thisid);
        var nextIndex = parseInt(thisid) + 1;
        var maxInd = $("div[id^='commRow']").length;
        $("div[id^='commRow']").each(function () {
            var tId = $(this).attr("id").substring(7);
            tId = parseInt(tId);
            if (tId > maxInd) {
                maxInd = parseInt(tId);
            }
            var thisIndex = $(this).find(".width106").find("label").html();
            thisIndex = parseInt(thisIndex);
            var nextId = thisIndex + 1;
            if (thisIndex > thisid) {
                $("div[id=commRow" + tId + "]").find(".width106").find("label").html(nextId);
                $("div[id=commRow" + tId + "]").find(".width106").find("input").val(nextId);
            }
        });
        var ind = maxInd + 1;
        var medalHtml = '';
        medalHtml += '<div id="commRow' + ind + '">';
        medalHtml += '	<div class="layui-form-item">';
        medalHtml += '	<div class="layui-inline width106">';
        medalHtml += '		<p class="right">子项<label>' + nextIndex + '</label>：</p>';
        medalHtml += '		<input type="hidden" name="orderIdx" value="' + nextIndex + '"/>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<label class="layui-form-label width60">子项名称</label>';
        medalHtml += '		<div class="layui-input-inline" style="width:120px;">';
        medalHtml += '			<input type="text" name="subName" value="" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">';
        medalHtml += '		</div>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<label class="layui-form-label width98">合作周期（年）</label>';
        medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
        medalHtml += '			<input type="text" name="subWorkYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
        medalHtml += '		</div>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<label class="layui-form-label width98">建设周期（年）</label>';
        medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
        medalHtml += '			<input type="text" name="subBuildYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
        medalHtml += '		</div>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<label class="layui-form-label width98">运营周期（年）</label>';
        medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
        medalHtml += '			<input type="text" name="subOmYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
        medalHtml += '		</div>';
        medalHtml += '	</div>';
        medalHtml += '	<div class="layui-inline">';
        medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addCommBtn' + ind + '" onclick="addCommRow(this);"><i class="layui-icon">&#xe654;</i></button>';
        medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delCommBtn' + ind + '" onclick="deleteCommRow(' + ind + ');"><i class="layui-icon">&#xe640;</i></button>';
        medalHtml += '	</div>';
        medalHtml += '	</div>';
        medalHtml += '</div>';
        $(t).parent().parent().parent().after(medalHtml);
        layui.form.render();
    }

    //删除一行
    function deleteCommRow(id) {
        var $ = layui.$;
        layui.layer.confirm('确定删除？', {icon: 3, title: '提示'}, function (index) {
            var rowLength = $("div[id^='commRow']").length;
            var thisid = $("div[id=commRow" + id + "]").find(".width106").find("label").html();
            thisid = parseInt(thisid);
            $("div[id^='commRow']").each(function () {
                var tId = $(this).attr("id").substring(7);
                tId = parseInt(tId);
                var thisIndex = $("div[id=commRow" + tId + "]").find(".width106").find("label").html();
                thisIndex = parseInt(thisIndex);
                var nextId = thisIndex - 1;
                if (thisIndex > thisid) {
                    $("div[id=commRow" + tId + "]").find(".width106").find("label").html(nextId);
                    $("div[id=commRow" + tId + "]").find(".width106").find("input").val(nextId);
                }
            });
            $("#commRow" + id).remove();
            //剩下最后一行，删除按钮隐藏，input验证关闭
            var delBtnCount = $("button[id^='delCommBtn']").length;
            if (delBtnCount == 1) {
                $("button[id^='delCommBtn']").each(function () {
                    $(this).attr("style", "display:none");
                });
            }
            layui.layer.close(index);
        });
    }

    //删除文件
    function del(index) {
        layui.$("#fileAtt_" + index).remove();
        layui.$("#upload_img_" + index).remove();
    }

    //根据url查看文件
    function showImg(url) {
        var openWin = window.open(url, '', 'left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }

    //计算子项最大值
    function checkMaxValue(obj) {
        if (obj.value == '' || obj.value == null) {
            return;
        }
        var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

        var boolrgx = rgx.test(obj.value);// true
        if (!boolrgx) {
            obj.value = 0;
            layer.msg('请输入正确数字，且保留两位小数！');
            return;
        }
        var $ = layui.$;
        var thisVal = parseFloat(obj.value);
        var name = $(obj).attr("name");
        var maxVal = thisVal;
        if ($("input[name=" + name + "]").length > 1) {
            $("input[name=" + name + "]").each(function () {
                var tId = $(this).val();
                tId = parseFloat(tId).toFixed(2);
                if (tId > thisVal) {
                    maxVal = tId;
                }
            });
        }
        maxVal = parseFloat(maxVal).toFixed(2);
        if (name == 'subWorkYears') {
            $("input[name=workYears]").val(maxVal);
        } else if (name == 'subBuildYears') {
            $("input[name=buildYears]").val(maxVal);
        } else if (name == 'subOmYears') {
            $("input[name=omYears]").val(maxVal);
        }
    }

    //计算总投资额、建安工程总费用
    function calcSumAmount() {
        var $ = layui.$;
        var costCae = $("#costCae").val();
        var deviceCost = $("#deviceCost").val();
        var inReadyCost = $("#inReadyCost").val();
        var periodInterest = $("#periodInterest").val();
        var fluidCapital = $("#fluidCapital").val();
        var otherCost = $("#otherCost").val();
        var totalAmount = 0;
        var sumCae = 0;
        var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

        if (costCae != '' && parseFloat(costCae) >= 0 && rgx.test(costCae) == true) {
            totalAmount = parseFloat(totalAmount) + parseFloat(costCae);
            totalAmount = totalAmount.toFixed(2);
            sumCae = totalAmount;
        } else {
            costCae = 0;
            $("#costCae").val(0);
            totalAmount = parseFloat(totalAmount) + parseFloat(costCae);
            totalAmount = totalAmount.toFixed(2);
            sumCae = totalAmount;
            layer.msg('请输入正确数字，且保留两位小数！');
        }
        if (deviceCost != '' && parseFloat(deviceCost) >= 0 && rgx.test(deviceCost) == true) {
            totalAmount = parseFloat(totalAmount) + parseFloat(deviceCost);
            totalAmount = totalAmount.toFixed(2);
            sumCae = totalAmount;
        } else {
            deviceCost = 0;
            $("#deviceCost").val(0);
            totalAmount = parseFloat(totalAmount) + parseFloat(deviceCost);
            totalAmount = totalAmount.toFixed(2);
            sumCae = totalAmount;
            layer.msg('请输入正确数字，且保留两位小数！');
        }
        if (inReadyCost != '' && parseFloat(inReadyCost) >= 0 && rgx.test(inReadyCost) == true) {
            totalAmount = parseFloat(totalAmount) + parseFloat(inReadyCost);
            totalAmount = totalAmount.toFixed(2);
            sumCae = totalAmount;
        } else {
            inReadyCost = 0;
            $("#inReadyCost").val(0);
            totalAmount = parseFloat(totalAmount) + parseFloat(inReadyCost);
            totalAmount = totalAmount.toFixed(2);
            sumCae = totalAmount;
            layer.msg('请输入正确数字，且保留两位小数！');
        }
        if (periodInterest != '' && parseFloat(periodInterest) >= 0 && rgx.test(periodInterest) == true) {
            totalAmount = parseFloat(totalAmount) + parseFloat(periodInterest);
            totalAmount = totalAmount.toFixed(2);
        } else {
            periodInterest = 0;
            $("#periodInterest").val(0);
            totalAmount = parseFloat(totalAmount) + parseFloat(periodInterest);
            totalAmount = totalAmount.toFixed(2);
            layer.msg('请输入正确数字，且保留两位小数！');
        }
        if (fluidCapital != '' && parseFloat(fluidCapital) >= 0 && rgx.test(fluidCapital) == true) {
            totalAmount = parseFloat(totalAmount) + parseFloat(fluidCapital);
            totalAmount = totalAmount.toFixed(2);
        } else {
            fluidCapital = 0;
            $("#fluidCapital").val(0);
            totalAmount = parseFloat(totalAmount) + parseFloat(fluidCapital);
            totalAmount = totalAmount.toFixed(2);
            layer.msg('请输入正确数字，且保留两位小数！');
        }
        if (otherCost != '' && parseFloat(otherCost) >= 0 && rgx.test(otherCost) == true) {
            totalAmount = parseFloat(totalAmount) + parseFloat(otherCost);
            totalAmount = totalAmount.toFixed(2);
        } else {
            otherCost = 0;
            $("#otherCost").val(0);
            totalAmount = parseFloat(totalAmount) + parseFloat(otherCost);
            totalAmount = totalAmount.toFixed(2);
            layer.msg('请输入正确数字，且保留两位小数！');
        }
        $("#sumAmount").val(totalAmount);
        $("#sumCae").val(sumCae);
    }

    //'请输入正确数字，且保留两位小数！'
    function isNumberAndFloat1(str) {
        var $ = layui.$, form = layui.form
        if (str.value == '' || str.value == null) {
            return;
        }
        var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

        var boolrgx = rgx.test(str.value);// true
        if (boolrgx) {
            return true;
        } else {
            str.value = 0;
            layer.msg('请输入正确数字，且保留两位小数！');
            return false;
        }
    }
</script>
</body>
</html>

